home *** CD-ROM | disk | FTP | other *** search
/ Netscape Plug-Ins Developer's Kit / Netscape_Plug-Ins_Developers_Kit.iso / CGIPERL / MACPERL / MSRCE418.HQX / Perl Source ƒ / MacPerl / CompareVars < prev    next >
Encoding:
Text File  |  1993-10-16  |  653 b   |  37 lines

  1. Perl -Sx "{0}" {"Parameters"}
  2. Exit 0
  3.  
  4. #!perl
  5.  
  6. ($good, $bad) = @ARGV;
  7.  
  8. open(MAP,     "MacPerl.map") ||╩die;
  9. open(GOOD,     $good)             || die;
  10. open(BAD,    $bad)                || die;
  11.  
  12. while (<MAP>) {
  13.     next unless /(\S+).*-\$(.*)\(A5\).*=\$(\S+)/;
  14.     
  15.     ($name, $offset, $size) = ($1, hex($2), hex($3));
  16.     
  17.     next if ($name eq "%?Anon");
  18.     
  19.     seek(GOOD, -$offset, 2);
  20.     seek(BAD, -$offset, 2);
  21.     
  22.     read(GOOD, $good, $size);
  23.     read(BAD, $bad, $size);
  24.     
  25.     next if ($good eq $bad);
  26.     
  27.     if ($size > 16) {
  28.         seek(GOOD, -$offset, 2);
  29.         seek(BAD, -$offset, 2);
  30.     
  31.         read(GOOD, $good, 16);
  32.         read(BAD, $bad, 16);
  33.     }
  34.     
  35.     printf("%s\n\t%s\n\t%s\n", $name, unpack("H*", $good), unpack("H*", $bad));
  36. }
  37.